home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / ODRecord.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  3.3 KB  |  164 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: ODRecord.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODRecord_xh
  18. #define SOM_ODRecord_xh
  19.  
  20. class ODRecord;
  21.  
  22. #define ODRecord_MajorVersion 1
  23. #define ODRecord_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODDescList_xh
  31. #include <ODDesLst.xh>
  32. #endif
  33.  
  34. #ifndef ODRecord_API
  35. #define ODRecord_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODDesc;
  50. class ODDescList;
  51. class ODRecord;
  52.  
  53. /*
  54.  * End of user-defined types.
  55.  */
  56.  
  57. #ifdef OLDIBMSOMAPISUPPORT
  58. #define ODRecordCClassData ODRecordClassData
  59. #define ODRecordNewClass(major,minor) somNewVersionedClassReference(ODRecord,major,minor)
  60. #endif
  61.  
  62. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  63. #define ODRecordMetaClass SOMClass
  64.  
  65. #if PRAGMA_ALIGN_SUPPORTED
  66. #  pragma options align=power
  67. #endif
  68.  
  69. /* The API to the ODRecord class object, and the methods it introduces. */
  70. SOMEXTERN struct ODRecordClassDataStructure {
  71. #ifdef OLDIBMSOMAPISUPPORT
  72.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  73. #else
  74.     long zero;
  75. #endif
  76.     somStaticClassInfo *sci;
  77.     somDToken        instanceDataToken;
  78.     long reserved [3];
  79.     somMToken InitODRecord;
  80. } SOMDLINK ODRecordClassData;
  81.  
  82. #if PRAGMA_ALIGN_SUPPORTED
  83. #  pragma options align=reset
  84. #endif
  85.  
  86. #if !defined(ODRecord_Class_Source) && !defined(SOM_Module_odrecord_Source)
  87. #if PRAGMA_IMPORT_SUPPORTED
  88. #pragma import list ODRecordClassData
  89. #endif
  90. #endif
  91.  
  92.  
  93. /*
  94.  * -- Typedefs and inline method declarations for left path inherited methods
  95.  * -- are omitted because this compilation had -museinheritedmethods in effect
  96.  */
  97.  
  98.  
  99. /*
  100.  * -- Typedefs for ODRecord Method Procedures
  101.  */
  102. SOMEXTERN {
  103. typedef void   (* SOMLINK somTD_ODRecord_InitODRecord)(ODRecord *somSelf, Environment *ev);
  104. }
  105.  
  106. #endif /* ODRecord_API */
  107.  
  108.  
  109. /*
  110.  * -- This emitter treats Method Tokens as Thunks by default.
  111.  * -- Use the sc modifier "nothunks" to change this default
  112.  */
  113. #undef somresolve_
  114. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  115.  
  116. /*
  117.  * -- The C++ Wrapper Class for ODRecord
  118.  */
  119. class ODRecord : public ODDescList
  120. {
  121. public:
  122.  
  123. // ODRecord::new registers use of the class object, and then uses somNew
  124. // to allocate memory and load the object method table pointer. 
  125. void *operator new(size_t size)
  126. {
  127.     SOM_IgnoreWarning(size);
  128.     // Allocate memory using the default allocator for ODRecord, and
  129.     // clear mem & set method table pointer, call basic initialization
  130. #ifdef SOMCHKNULL
  131.     void * __somResult = (void *)
  132.       somNewObject(ODRecord);
  133.     SOMCHKNULL(__somResult);
  134.     return __somResult;
  135. #else
  136.     return (void*) somNewObject(ODRecord);
  137. #endif
  138. }
  139.  
  140. // ODRecord::delete uses the default deallocator for the object's class.
  141. void operator delete(void * obj)
  142. {
  143.     if (obj) {
  144.         SOM_Resolve(obj,SOMObject,somFree)
  145.            ( (SOMObject*) obj );
  146.     }
  147. }
  148.  
  149. /* method: InitODRecord */
  150. void   InitODRecord(Environment *ev)
  151. {
  152.    SOM_ResolveD(this,ODRecord,ODRecord,InitODRecord)
  153.     (this,ev);
  154. #ifdef SOMCHKEXCEPT
  155.       SOMCHKEXCEPT;
  156. #endif
  157. }
  158.  
  159. };   /* ODRecord */
  160.  
  161.  
  162.  
  163. #endif       /* SOM_ODRecord_xh */
  164.